"use strict";
var Locale = require("element-ui/lib/mixins/locale");
var EleCropper = require("../ele-cropper");
var EleModal = require("../ele-modal");
function _interopDefaultLegacy(e) {
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
}
var Locale__default = /* @__PURE__ */ _interopDefaultLegacy(Locale);
var EleCropper__default = /* @__PURE__ */ _interopDefaultLegacy(EleCropper);
var EleModal__default = /* @__PURE__ */ _interopDefaultLegacy(EleModal);
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("ele-modal", { attrs: { "visible": _vm.show, "title": _vm.title || _vm.t("ele.cropper.title"), "width": _vm.width, "show-close": _vm.showClose, "custom-class": _vm.customClass, "close-on-click-modal": _vm.closeOnClickModal, "close-on-press-escape": _vm.closeOnPressEscape, "destroy-on-close": _vm.destroyOnClose, "lock-scroll": _vm.lockScroll, "append-to-body": _vm.appendToBody, "modal-append-to-body": _vm.modalAppendToBody, "modal": _vm.modal, "top": _vm.top, "movable": _vm.movable, "move-out": _vm.moveOut, "move-out-positive": _vm.moveOutPositive, "resizable": _vm.resizable, "maxable": _vm.maxable, "multiple": _vm.multiple, "fullscreen": _vm.fullscreen, "inner": _vm.inner, "reset-on-close": _vm.resetOnClose, "centered": _vm.centered, "mask-keep-alive": false }, on: { "open": _vm.onOpen, "closed": _vm.onClosed, "update:visible": _vm.updateVisible } }, [_c("template", { slot: "title" }, [_vm._t("title")], 2), _vm.showCropper ? _c("EleCropper", { attrs: { "src": _vm.src, "aspect-ratio": _vm.aspectRatio, "view-mode": _vm.viewMode, "accept": _vm.accept, "drag-mode": _vm.dragMode, "initial-aspect-ratio": _vm.initialAspectRatio, "min-container-width": _vm.minContainerWidth, "min-container-height": _vm.minContainerHeight, "min-canvas-width": _vm.minCanvasWidth, "min-canvas-height": _vm.minCanvasHeight, "min-crop-box-width": _vm.minCropBoxWidth, "min-crop-box-height": _vm.minCropBoxHeight, "cropped-width": _vm.croppedWidth, "cropped-height": _vm.croppedHeight, "cropped-min-width": _vm.croppedMinWidth, "cropped-min-height": _vm.croppedMinHeight, "cropped-max-width": _vm.croppedMaxWidth, "cropped-max-height": _vm.croppedMaxHeight, "cropped-fill-color": _vm.croppedFillColor, "to-blob": _vm.toBlob, "image-smoothing-enabled": _vm.imageSmoothingEnabled, "image-smoothing-quality": _vm.imageSmoothingQuality, "tools": _vm.tools, "show-preview": _vm.showPreview, "ok-text": _vm.okText }, on: { "crop": _vm.onCrop } }) : _vm._e(), _c("template", { slot: "footer" }, [_vm._t("default")], 2)], 2);
};
var staticRenderFns = [];
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
  if (render2) {
    options.render = render2;
    options.staticRenderFns = staticRenderFns2;
    options._compiled = true;
  }
  if (functionalTemplate) {
    options.functional = true;
  }
  if (scopeId) {
    options._scopeId = "data-v-" + scopeId;
  }
  var hook;
  if (moduleIdentifier) {
    hook = function(context) {
      context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
      if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
        context = __VUE_SSR_CONTEXT__;
      }
      if (injectStyles) {
        injectStyles.call(this, context);
      }
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier);
      }
    };
    options._ssrRegister = hook;
  } else if (injectStyles) {
    hook = shadowMode ? function() {
      injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
    } : injectStyles;
  }
  if (hook) {
    if (options.functional) {
      options._injectStyles = hook;
      var originalRender = options.render;
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context);
        return originalRender(h, context);
      };
    } else {
      var existing = options.beforeCreate;
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
    }
  }
  return {
    exports: scriptExports,
    options
  };
}
const __vue2_script = {
  name: "EleCropperDialog",
  mixins: [Locale__default["default"]],
  components: { EleCropper: EleCropper__default["default"], EleModal: EleModal__default["default"] },
  props: {
    show: Boolean,
    src: String,
    aspectRatio: {
      type: Number,
      default: 1
    },
    viewMode: Number,
    dragMode: String,
    initialAspectRatio: Number,
    minContainerWidth: Number,
    minContainerHeight: Number,
    minCanvasWidth: Number,
    minCanvasHeight: Number,
    minCropBoxWidth: Number,
    minCropBoxHeight: Number,
    croppedWidth: Number,
    croppedHeight: Number,
    croppedMinWidth: Number,
    croppedMinHeight: Number,
    croppedMaxWidth: Number,
    croppedMaxHeight: Number,
    croppedFillColor: Number,
    imageSmoothingEnabled: Boolean,
    imageSmoothingQuality: String,
    toBlob: Boolean,
    accept: String,
    tools: String,
    showPreview: {
      type: Boolean,
      default: true
    },
    okText: String,
    title: String,
    width: {
      type: String,
      default: "680px"
    },
    customClass: String,
    closeOnClickModal: {
      type: Boolean,
      default: true
    },
    closeOnPressEscape: {
      type: Boolean,
      default: true
    },
    showClose: {
      type: Boolean,
      default: true
    },
    lockScroll: {
      type: Boolean,
      default: true
    },
    appendToBody: Boolean,
    modalAppendToBody: {
      type: Boolean,
      default: true
    },
    modal: {
      type: Boolean,
      default: true
    },
    top: String,
    destroyOnClose: {
      type: Boolean,
      default: false
    },
    movable: {
      type: Boolean,
      default: true
    },
    moveOut: Boolean,
    moveOutPositive: Boolean,
    resizable: [Boolean, String],
    maxable: Boolean,
    multiple: Boolean,
    fullscreen: Boolean,
    inner: Boolean,
    resetOnClose: {
      type: Boolean,
      default: true
    },
    centered: Boolean
  },
  emits: ["crop", "open", "closed", "update:show"],
  data() {
    return {
      showCropper: false
    };
  },
  methods: {
    onOpen() {
      this.showCropper = true;
      this.$emit("open");
    },
    onClosed() {
      if (this.destroyOnClose) {
        this.showCropper = false;
      }
      this.$emit("closed");
    },
    onCrop(result) {
      this.$emit("crop", result);
    },
    updateVisible(value) {
      this.$emit("update:show", value);
    }
  }
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
  for (let o in __cssModules) {
    this[o] = __cssModules[o];
  }
}
var index = /* @__PURE__ */ function() {
  return __component__.exports;
}();
module.exports = index;
